package usocket

import "syscall"

// setOpenFileLimit set process open file limit
func SetOpenFileLimit() {
	var rlim syscall.Rlimit
	err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim)
	if err != nil {
		panic(err.Error())
	}

	rlim.Cur = 655350
	rlim.Max = 655350
	err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
	if err != nil {
		panic(err.Error())
	}
	return
}